window.addEventListener("load", () => {
    // let parent = document.getElementById("parent")
    // let child = document.getElementById("child")

    // child.addEventListener("click", (event) => {
    //     event.stopPropagation() //组织传播
    //     console.log("child")
    // })
    parent.addEventListener("click", () => {
            console.log("parent")
        })
        // document.querySelectorAll("ul li")[0].addEventListener("click", (event) => {
        //         console.log(event.target.innerText)
        //     })
        // document.querySelectorAll("ul li")[1].addEventListener("click", (event) => {
        //     console.log(event.target.innerText)
        // })
        // document.querySelectorAll("ul li")[2].addEventListener("click", (event) => {
        //     console.log(event.target.innerText)
        // })
        // document.querySelectorAll("ul li")[3].addEventListener("click", (event) => {
        //     console.log(event.target.innerText)
        // })
    document.querySelectorAll("ul")[0].addEventListener("click", (event) => {
        console.log(event.currentTarget)
        console.log(event.target.innerText)
    })
    document.querySelectorAll("ul")[0].addEventListener("click", (event) => {
        console.log("这是捕获阶段")
    }, true)

    // document.getElementsByTagName("a")[0].addEventListener("click", (event) => {
    //     event.preventDefault()
    //     console.log("正在点击链接尝试跳转中")
    // })

    document.querySelectorAll("ul")[0].addEventListener("click", (event) => {
        // event.target.remove()
        event.target.append("不要乱点！！！")
    })

    //层级关系
    //window -> document -> html -> body -> div\ul\form...
    //对于html的查找应用
    console.log(document.documentElement)
        //对于boby的查找
    console.log(document.body)
        //对于body的直接调用
    document.body.append("你好你好")
    window.alert("页面加载中")
})